﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Axe.Collections
{
    public class MinMaxAvg<T> : IEquatable<MinMaxAvg<T>>
        where T : IComparable<T>
    {
        T m_Min;
        T m_Max;
        T m_Avg;

        public T Min
        {
            get { return m_Min; }
            set { m_Min = value; }
        }

        public T Max
        {
            get { return m_Max; }
            set { m_Max = value; }
        }

        public T Avg
        {
            get { return m_Avg; }
            set { m_Avg = value; }
        }

        #region IEquatable<MinMaxAvg<T>> Members

        public bool Equals(MinMaxAvg<T> other)
        {
            return
                other.m_Avg.CompareTo(m_Avg) == 0 &&
                other.m_Min.CompareTo(m_Min) == 0 &&
                other.m_Max.CompareTo(m_Max) == 0; 

        }

        #endregion
    }
}
